All Functions Used So Far, Week 7

as.character

{base}

Coerce a vector to character

complete.cases

{stats}

Find Complete Cases

summary

{base}

Obtain summary statistics or detailed regression output

var

{stats}

Calculate variance

ungroup

{dplyr}

Resolve grouping created with “group_by”

tibble

{tibble}

A modern data frame from the tidyverse

ls

{base}

Return a vector of character strings giving the names of the objects in the specified environment

order

{base}

Get indexes that will sort a vector

library

{base}

Load an R package

auc

{pRoc}

Returns the area under the curve

attr

{base}

Access or modify the attributes of an object

regTermTest

{regress}

Perform statistical tests for individual regression coefficients

sample

{base}

Takes a sample of the specified size

factor

{base}

Create a factor

c

{base}

Combine values/vectors into a vector

str

{utils}

Get the structure of an R object

quantile

{stats}

Obtain empirical quantiles of a vector

filter

{dplyr}

Filter out rows of a data frame according to logical vector

list

{base}

Create a list object

expression

{base}

Used in plots to add symbols to axes

range

{base}

Return range of values

rm

{base}

Remove objects

plot

{graphics}

Generic function from base R to produce a plot

log

{base}

log (default base = e)

cut

{base}

Convert Numeric to Factor

which

{base}

return indexes of TRUE entries of a logical vector

subset

{base}

Return subsets of vectors, matrices or data frames which meet conditions.

scale_color_manual

{ggplot2}

Manually sets the colours used in a ggplot color scale to user-specified values

lag

{dplyr}

Shift values in a vector or time series

read.csv

{utils}

Read a csv file to data frame. Specify stringsAsFactors = FALSE to keep all string columns as characters

modelsummary

{modelsummary}

Creates regression and data tables

ifelse

{base}

Return a or b depending on the value of test

group_by

{dplyr}

Group tibble/data.frame by a factor variable. All further tidyverse operations are performed group-wise

as.numeric

{base}

Coerce a vector to numeric

ordered

{dplyr}

Create an ordered factor

max

{base}

Get maximum of a vector

head

{utils}

Show first 5 rows of a data frame

median

{stats}

Get median of a vector

bar

{base}

Used for annotations, such as “expression(paste(”-“,bar(y)))”

is.na

{base}

Check if a value is NA/elements of vector are NA

lm

{stats}

Fit linear models using least squares

length

{base}

Returns number of elements in an object

mean

{base}

Get mean of a vector

dnorm

{stats}

Density distribution for the normal distribution

roc

{pRoc}

Create a Receiver Operating Characteristic (ROC) curve

factor

{base}

Create factor variables

par

{graphics}

Set parameters of the plotting device

mutate

{dplyr}

Create new variables

glm

{base}

Fits generalized linear models

rnorm

{base}

Generate random numbers from a normal distribution

min

{base}

Get minimum of a vector

setwd

{base}

Set Working Directory

nobs

{stats}

Return the number of observations in a model object

binomial

{base}

Family argument in glm()

xlim

{ggplot2}

A shortcut to set the limits of the x-axis in a ggplot

sd

{stats}

Get standard deviation of a vector

colMeans

{base}

Computes the means of each column of a numeric matrix or data frame

group_tt

{tinytable}

Grouping in tinytable

seq

{base}

Create a sequence

arrange

{dplyr}

Sort values of data frame according to a variable/combination of variables

data.frame

{base}

Create a data.frame from vectors

as.data.frame

{base}

Functions to check if an object is a data frame, or coerce it if possible.

names

{base}

Get or set names of an object

pnorm

{base}

Returns the cumulative distribution function (CDF) of the normal distribution

rbind

{base}

Combine R objects by rows

read_excel

{readxl}

Read an Excel file

unlist

{base}

Flattens a list into a vector by extracting all its elements

nrow

{base}

Get number of rows of a data frame

grid.arrange

{gridExtra}

Places graphical objects into a rectangular grid

predict

{stats}

Generate predicted values from model objects

The end!